<template>
	<div class="p-grid">
		<div class="p-col-12 p-md-6">
			<div class="card p-fluid">
				<h5>垂直布局</h5>
				<div class="p-field">
					<label for="name1">姓名</label>
					<InputText id="name1" type="text" />
				</div>
				<div class="p-field">
					<label for="email1">邮件</label>
					<InputText id="email1" type="text" />
				</div>
				<div class="p-field">
					<label for="age1">年龄</label>
					<InputText id="age1" type="text" />
				</div>
			</div>

			<div class="card p-fluid">
				<h5>垂直网格</h5>
				<div class="p-formgrid p-grid">
					<div class="p-field p-col">
						<label for="name2">姓名</label>
						<InputText id="name2" type="text" />
					</div>
					<div class="p-field p-col">
						<label for="email2">邮件</label>
						<InputText id="email2" type="text" />
					</div>
				</div>
			</div>
		</div>

		<div class="p-col-12 p-md-6">
			<div class="card p-fluid">
				<h5>水平布局</h5>
				<div class="p-field p-grid">
					<label for="name3" class="p-col-12 p-mb-2 p-md-2 p-mb-md-0">姓名</label>
					<div class="p-col-12 p-md-10">
						<InputText id="name3" type="text" />
					</div>
				</div>
				<div class="p-field p-grid">
					<label for="email3" class="p-col-12 p-mb-2 p-md-2 p-mb-md-0">邮件</label>
					<div class="p-col-12 p-md-10">
						<InputText id="email3" type="text" />
					</div>
				</div>
			</div>

			<div class="card">
				<h5>内联布局</h5>
				<div class="p-formgroup-inline">
					<div class="p-field">
						<label for="firstname1" class="p-sr-only">姓</label>
						<InputText id="firstname1" type="text" placeholder="姓"/>
					</div>
					<div class="p-field">
						<label for="lastname1" class="p-sr-only">名</label>
						<InputText id="lastname1" type="text" placeholder="名"/>
					</div>
					<Button label="提交"></Button>
				</div>
			</div>

			<div class="card">
				<h5>帮助文字</h5>
				<div class="p-field p-fluid">
					<label for="username">用户名</label>
					<InputText id="username" type="text" />
					<small>输入您的用户名以重置密码。</small>
				</div>
			</div>
		</div>

		<div class="p-col-12">
			<div class="card">
				<h5>高级布局</h5>
				<div class="p-fluid p-formgrid p-grid">
					<div class="p-field p-col-12 p-md-6">
						<label for="firstname2">姓名</label>
						<InputText id="firstname2" type="text"/>
					</div>
					<div class="p-field p-col-12 p-md-6">
						<label for="tel">电话</label>
						<InputText id="tel" type="text"/>
					</div>
					<div class="p-field p-col-12">
						<label for="address">地址</label>
						<Textarea id="address" type="text" rows="4"/>
					</div>
					<div class="p-field p-col-12 p-md-6">
						<label for="city">市</label>
						<InputText id="city" type="text" />
					</div>
					<div class="p-field p-col-12 p-md-3">
						<label for="state">省</label>
						<Dropdown id="state" v-model="dropdownItem" :options="dropdownItems" optionLabel="name" placeholder="请选择"></Dropdown>
					</div>
					<div class="p-field p-col-12 p-md-3">
						<label for="zip">邮编</label>
						<InputText id="zip" type="text"/>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				dropdownItems: [
					{name: '江苏', code: 'Option 1'},
					{name: '安徽', code: 'Option 2'},
					{name: '福建', code: 'Option 3'}
				],
				dropdownItem: null,
			}
		}
	}
</script>
